#!/bin/bash
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
git clone https://gitcode.com/openharmony-sig/communication_t2stack.git foundation/communication/t2stack
git clone https://gitee.com/luo_ju_heng/blue_build.git
rm productdefine/common/inherit/rich.json
cp blue_build/rich.json productdefine/common/inherit/

bash build/prebuilts_download.sh

./build.sh --product-name rk3568 --build-target foundation/communication/t2stack:nstackx --gn-args allow_sanitize_debug=true --ccache --no-prebuilt-sdk

mkdir -p out/default/src/dsoftbus
cp -r out/rk3568/communication/t2stack out/default/src/dsoftbus/t2stack